package com.xujie.sportsmeeting.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 裁判员实体
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("judge")
public class Judge implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 裁判员ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 关联用户ID
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 工号
     */
    @NotBlank(message = "工号不能为空")
    @TableField("work_number")
    private String workNumber;

    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空")
    @TableField("real_name")
    private String realName;

    /**
     * 性别 0-男 1-女
     */
    @TableField("gender")
    private Integer gender;

    /**
     * 联系方式
     */
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    @TableField("phone")
    private String phone;

    /**
     * 邮箱
     */
    @Email(message = "邮箱格式不正确")
    @TableField("email")
    private String email;

    /**
     * 所属部门
     */
    @TableField("department")
    private String department;

    /**
     * 专业等级
     */
    @TableField("professional_level")
    private String professionalLevel;

    /**
     * 专业特长
     */
    @TableField("speciality")
    private String speciality;

    /**
     * 资格证书
     */
    @TableField("certificate")
    private String certificate;

    /**
     * 执裁经验年数
     */
    @TableField("experience_years")
    private Integer experienceYears;

    /**
     * 状态 0-禁用 1-正常
     */
    @TableField("status")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
